package com.cy.interceptor;

import com.cy.pojo.Handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author ChenYan
 * @Date 2021/8/3 13:22
 * @Description
 */
public interface HandleInterceptor {

    /**
     * 处理前拦截
     * @param request
     * @param response
     * @param handler
     * @return
     * @throws Exception
     */
    boolean preHandle(HttpServletRequest request, HttpServletResponse response, Handler handler)
            throws Exception;

    /**
     * 处理后
     * @param request
     * @param response
     * @param handler
     * @throws Exception
     */
    void postHandle(
            HttpServletRequest request, HttpServletResponse response, Object handler)
            throws Exception;

    void afterCompletion(
            HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
            throws Exception;

}
